<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Doxygen: pcl::search::Search&lt; PointT &gt; 模板类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Doxygen
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'搜索','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('classpcl_1_1search_1_1_search.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">类</a> &#124;
<a href="#pub-types">Public 类型</a> &#124;
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="#pro-methods">Protected 成员函数</a> &#124;
<a href="#pro-attribs">Protected 属性</a> &#124;
<a href="classpcl_1_1search_1_1_search-members.html">所有成员列表</a>  </div>
  <div class="headertitle">
<div class="title">pcl::search::Search&lt; PointT &gt; 模板类 参考<span class="mlabels"><span class="mlabel">abstract</span></span></div>  </div>
</div><!--header-->
<div class="contents">

<p>Generic search class. All search wrappers must inherit from this.  
 <a href="classpcl_1_1search_1_1_search.html#details">更多...</a></p>

<p><code>#include &lt;<a class="el" href="search_8h_source.html">search.h</a>&gt;</code></p>
<div class="dynheader">
类 pcl::search::Search&lt; PointT &gt; 继承关系图:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classpcl_1_1search_1_1_search.png" usemap="#pcl::search::Search_3C_20PointT_20_3E_map" alt=""/>
  <map id="pcl::search::Search_3C_20PointT_20_3E_map" name="pcl::search::Search_3C_20PointT_20_3E_map">
<area href="classpcl_1_1search_1_1_kd_tree.html" alt="pcl::search::KdTree&lt; PointTarget &gt;" shape="rect" coords="0,56,391,80"/>
<area href="classpcl_1_1search_1_1_kd_tree.html" alt="pcl::search::KdTree&lt; SceneT &gt;" shape="rect" coords="401,56,792,80"/>
<area href="classpcl_1_1search_1_1_brute_force.html" title="Implementation of a simple brute force search algorithm." alt="pcl::search::BruteForce&lt; PointT &gt;" shape="rect" coords="802,56,1193,80"/>
<area href="classpcl_1_1search_1_1_flann_search.html" title="search::FlannSearch is a generic FLANN wrapper class for the new search interface...." alt="pcl::search::FlannSearch&lt; PointT, FlannDistance &gt;" shape="rect" coords="1203,56,1594,80"/>
<area href="classpcl_1_1search_1_1_kd_tree.html" title="search::KdTree is a wrapper class which inherits the pcl::KdTree class for performing search function..." alt="pcl::search::KdTree&lt; PointT, Tree &gt;" shape="rect" coords="1604,56,1995,80"/>
<area href="classpcl_1_1search_1_1_octree.html" title="search::Octree is a wrapper class which implements nearest neighbor search operations based on the pc..." alt="pcl::search::Octree&lt; PointT, LeafTWrap, BranchTWrap, OctreeT &gt;" shape="rect" coords="2005,56,2396,80"/>
<area href="classpcl_1_1search_1_1_organized_neighbor.html" title="OrganizedNeighbor is a class for optimized nearest neigbhor search in organized point clouds." alt="pcl::search::OrganizedNeighbor&lt; PointT &gt;" shape="rect" coords="2406,56,2797,80"/>
  </map>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
类</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structpcl_1_1search_1_1_search_1_1_compare.html">Compare</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public 类型</h2></td></tr>
<tr class="memitem:a24c22de8c0cfcedbbab42e3c25aa41f7"><td class="memItemLeft" align="right" valign="top"><a id="a24c22de8c0cfcedbbab42e3c25aa41f7"></a>
typedef <a class="el" href="classpcl_1_1_point_cloud.html">pcl::PointCloud</a>&lt; <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>PointCloud</b></td></tr>
<tr class="separator:a24c22de8c0cfcedbbab42e3c25aa41f7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a922d03abf030ab09d8dd4af8a5828065"><td class="memItemLeft" align="right" valign="top"><a id="a922d03abf030ab09d8dd4af8a5828065"></a>
typedef PointCloud::Ptr&#160;</td><td class="memItemRight" valign="bottom"><b>PointCloudPtr</b></td></tr>
<tr class="separator:a922d03abf030ab09d8dd4af8a5828065"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af089775487d2db25133d9e06152679ee"><td class="memItemLeft" align="right" valign="top"><a id="af089775487d2db25133d9e06152679ee"></a>
typedef PointCloud::ConstPtr&#160;</td><td class="memItemRight" valign="bottom"><b>PointCloudConstPtr</b></td></tr>
<tr class="separator:af089775487d2db25133d9e06152679ee"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae0bda42e747837e2398814c20eb6d517"><td class="memItemLeft" align="right" valign="top"><a id="ae0bda42e747837e2398814c20eb6d517"></a>
typedef boost::shared_ptr&lt; <a class="el" href="classpcl_1_1search_1_1_search.html">pcl::search::Search</a>&lt; <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>Ptr</b></td></tr>
<tr class="separator:ae0bda42e747837e2398814c20eb6d517"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2a5b59a5c47651341b662252dcb8550c"><td class="memItemLeft" align="right" valign="top"><a id="a2a5b59a5c47651341b662252dcb8550c"></a>
typedef boost::shared_ptr&lt; const <a class="el" href="classpcl_1_1search_1_1_search.html">pcl::search::Search</a>&lt; <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>ConstPtr</b></td></tr>
<tr class="separator:a2a5b59a5c47651341b662252dcb8550c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3b72144b949332536b816ed7cdcafda4"><td class="memItemLeft" align="right" valign="top"><a id="a3b72144b949332536b816ed7cdcafda4"></a>
typedef boost::shared_ptr&lt; std::vector&lt; int &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>IndicesPtr</b></td></tr>
<tr class="separator:a3b72144b949332536b816ed7cdcafda4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a95f5e7d01e595fb090d2d7841a1ea70c"><td class="memItemLeft" align="right" valign="top"><a id="a95f5e7d01e595fb090d2d7841a1ea70c"></a>
typedef boost::shared_ptr&lt; const std::vector&lt; int &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>IndicesConstPtr</b></td></tr>
<tr class="separator:a95f5e7d01e595fb090d2d7841a1ea70c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:a77f437ecf7fa36987632db9c2b450441"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1search_1_1_search.html#a77f437ecf7fa36987632db9c2b450441">Search</a> (const std::string &amp;name=&quot;&quot;, bool sorted=false)</td></tr>
<tr class="separator:a77f437ecf7fa36987632db9c2b450441"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a25fbcca7b8f88fdf464f8c9af576626c"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1search_1_1_search.html#a25fbcca7b8f88fdf464f8c9af576626c">~Search</a> ()</td></tr>
<tr class="separator:a25fbcca7b8f88fdf464f8c9af576626c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a58f09ccdd4f9296a3462f902f78ee544"><td class="memItemLeft" align="right" valign="top"><a id="a58f09ccdd4f9296a3462f902f78ee544"></a>
virtual const std::string &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1search_1_1_search.html#a58f09ccdd4f9296a3462f902f78ee544">getName</a> () const</td></tr>
<tr class="memdesc:a58f09ccdd4f9296a3462f902f78ee544"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the search method name <br /></td></tr>
<tr class="separator:a58f09ccdd4f9296a3462f902f78ee544"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af5e9ca2efdb199e64d05c399ea4a4412"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1search_1_1_search.html#af5e9ca2efdb199e64d05c399ea4a4412">setSortedResults</a> (bool sorted)</td></tr>
<tr class="memdesc:af5e9ca2efdb199e64d05c399ea4a4412"><td class="mdescLeft">&#160;</td><td class="mdescRight">sets whether the results should be sorted (ascending in the distance) or not  <a href="classpcl_1_1search_1_1_search.html#af5e9ca2efdb199e64d05c399ea4a4412">更多...</a><br /></td></tr>
<tr class="separator:af5e9ca2efdb199e64d05c399ea4a4412"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0ab66bf51224fca916cc193e953d39d8"><td class="memItemLeft" align="right" valign="top"><a id="a0ab66bf51224fca916cc193e953d39d8"></a>
virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1search_1_1_search.html#a0ab66bf51224fca916cc193e953d39d8">getSortedResults</a> ()</td></tr>
<tr class="memdesc:a0ab66bf51224fca916cc193e953d39d8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets whether the results should be sorted (ascending in the distance) or not Otherwise the results may be returned in any order. <br /></td></tr>
<tr class="separator:a0ab66bf51224fca916cc193e953d39d8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3f7aa9ba73d098c204bc8a6b9dd293dc"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1search_1_1_search.html#a3f7aa9ba73d098c204bc8a6b9dd293dc">setInputCloud</a> (const PointCloudConstPtr &amp;cloud, const IndicesConstPtr &amp;indices=IndicesConstPtr())</td></tr>
<tr class="memdesc:a3f7aa9ba73d098c204bc8a6b9dd293dc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pass the input dataset that the search will be performed on.  <a href="classpcl_1_1search_1_1_search.html#a3f7aa9ba73d098c204bc8a6b9dd293dc">更多...</a><br /></td></tr>
<tr class="separator:a3f7aa9ba73d098c204bc8a6b9dd293dc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac4a83e895b2a11e89319673117a927fa"><td class="memItemLeft" align="right" valign="top"><a id="ac4a83e895b2a11e89319673117a927fa"></a>
virtual PointCloudConstPtr&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1search_1_1_search.html#ac4a83e895b2a11e89319673117a927fa">getInputCloud</a> () const</td></tr>
<tr class="memdesc:ac4a83e895b2a11e89319673117a927fa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get a pointer to the input point cloud dataset. <br /></td></tr>
<tr class="separator:ac4a83e895b2a11e89319673117a927fa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0ba8e4114e97c267970b79fe6cf3697e"><td class="memItemLeft" align="right" valign="top"><a id="a0ba8e4114e97c267970b79fe6cf3697e"></a>
virtual IndicesConstPtr&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1search_1_1_search.html#a0ba8e4114e97c267970b79fe6cf3697e">getIndices</a> () const</td></tr>
<tr class="memdesc:a0ba8e4114e97c267970b79fe6cf3697e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get a pointer to the vector of indices used. <br /></td></tr>
<tr class="separator:a0ba8e4114e97c267970b79fe6cf3697e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a97b4eff97eaa23d4586ca9b16d1b0671"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1search_1_1_search.html#a97b4eff97eaa23d4586ca9b16d1b0671">nearestKSearch</a> (const <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &amp;point, int k, std::vector&lt; int &gt; &amp;k_indices, std::vector&lt; float &gt; &amp;k_sqr_distances) const =0</td></tr>
<tr class="memdesc:a97b4eff97eaa23d4586ca9b16d1b0671"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="classpcl_1_1search_1_1_search.html" title="Generic search class. All search wrappers must inherit from this.">Search</a> for the k-nearest neighbors for the given query point.  <a href="classpcl_1_1search_1_1_search.html#a97b4eff97eaa23d4586ca9b16d1b0671">更多...</a><br /></td></tr>
<tr class="separator:a97b4eff97eaa23d4586ca9b16d1b0671"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abe2901bec8399fdd4d62a4275d89528b"><td class="memTemplParams" colspan="2">template&lt;typename PointTDiff &gt; </td></tr>
<tr class="memitem:abe2901bec8399fdd4d62a4275d89528b"><td class="memTemplItemLeft" align="right" valign="top">int&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classpcl_1_1search_1_1_search.html#abe2901bec8399fdd4d62a4275d89528b">nearestKSearchT</a> (const PointTDiff &amp;point, int k, std::vector&lt; int &gt; &amp;k_indices, std::vector&lt; float &gt; &amp;k_sqr_distances) const</td></tr>
<tr class="memdesc:abe2901bec8399fdd4d62a4275d89528b"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="classpcl_1_1search_1_1_search.html" title="Generic search class. All search wrappers must inherit from this.">Search</a> for k-nearest neighbors for the given query point. This method accepts a different template parameter for the point type.  <a href="classpcl_1_1search_1_1_search.html#abe2901bec8399fdd4d62a4275d89528b">更多...</a><br /></td></tr>
<tr class="separator:abe2901bec8399fdd4d62a4275d89528b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5d7eedb3e5746257f121cdc675d6a21a"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1search_1_1_search.html#a5d7eedb3e5746257f121cdc675d6a21a">nearestKSearch</a> (const <a class="el" href="classpcl_1_1_point_cloud.html">PointCloud</a> &amp;cloud, int index, int k, std::vector&lt; int &gt; &amp;k_indices, std::vector&lt; float &gt; &amp;k_sqr_distances) const</td></tr>
<tr class="memdesc:a5d7eedb3e5746257f121cdc675d6a21a"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="classpcl_1_1search_1_1_search.html" title="Generic search class. All search wrappers must inherit from this.">Search</a> for k-nearest neighbors for the given query point.  <a href="classpcl_1_1search_1_1_search.html#a5d7eedb3e5746257f121cdc675d6a21a">更多...</a><br /></td></tr>
<tr class="separator:a5d7eedb3e5746257f121cdc675d6a21a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab79c10fe1e25b8c4a7104dd439e5f6e0"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1search_1_1_search.html#ab79c10fe1e25b8c4a7104dd439e5f6e0">nearestKSearch</a> (int index, int k, std::vector&lt; int &gt; &amp;k_indices, std::vector&lt; float &gt; &amp;k_sqr_distances) const</td></tr>
<tr class="memdesc:ab79c10fe1e25b8c4a7104dd439e5f6e0"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="classpcl_1_1search_1_1_search.html" title="Generic search class. All search wrappers must inherit from this.">Search</a> for k-nearest neighbors for the given query point (zero-copy).  <a href="classpcl_1_1search_1_1_search.html#ab79c10fe1e25b8c4a7104dd439e5f6e0">更多...</a><br /></td></tr>
<tr class="separator:ab79c10fe1e25b8c4a7104dd439e5f6e0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7191bd8166bed4623c27199bf59e972c"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1search_1_1_search.html#a7191bd8166bed4623c27199bf59e972c">nearestKSearch</a> (const <a class="el" href="classpcl_1_1_point_cloud.html">PointCloud</a> &amp;cloud, const std::vector&lt; int &gt; &amp;indices, int k, std::vector&lt; std::vector&lt; int &gt; &gt; &amp;k_indices, std::vector&lt; std::vector&lt; float &gt; &gt; &amp;k_sqr_distances) const</td></tr>
<tr class="memdesc:a7191bd8166bed4623c27199bf59e972c"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="classpcl_1_1search_1_1_search.html" title="Generic search class. All search wrappers must inherit from this.">Search</a> for the k-nearest neighbors for the given query point.  <a href="classpcl_1_1search_1_1_search.html#a7191bd8166bed4623c27199bf59e972c">更多...</a><br /></td></tr>
<tr class="separator:a7191bd8166bed4623c27199bf59e972c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5388aab8b46f3180b8ebe9001f1e75eb"><td class="memTemplParams" colspan="2">template&lt;typename PointTDiff &gt; </td></tr>
<tr class="memitem:a5388aab8b46f3180b8ebe9001f1e75eb"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classpcl_1_1search_1_1_search.html#a5388aab8b46f3180b8ebe9001f1e75eb">nearestKSearchT</a> (const <a class="el" href="classpcl_1_1_point_cloud.html">pcl::PointCloud</a>&lt; PointTDiff &gt; &amp;cloud, const std::vector&lt; int &gt; &amp;indices, int k, std::vector&lt; std::vector&lt; int &gt; &gt; &amp;k_indices, std::vector&lt; std::vector&lt; float &gt; &gt; &amp;k_sqr_distances) const</td></tr>
<tr class="memdesc:a5388aab8b46f3180b8ebe9001f1e75eb"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="classpcl_1_1search_1_1_search.html" title="Generic search class. All search wrappers must inherit from this.">Search</a> for the k-nearest neighbors for the given query point. Use this method if the query points are of a different type than the points in the data set (e.g. <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html" title="A point structure representing Euclidean xyz coordinates, and the RGBA color.">PointXYZRGBA</a> instead of <a class="el" href="structpcl_1_1_point_x_y_z.html" title="A point structure representing Euclidean xyz coordinates. (SSE friendly)">PointXYZ</a>).  <a href="classpcl_1_1search_1_1_search.html#a5388aab8b46f3180b8ebe9001f1e75eb">更多...</a><br /></td></tr>
<tr class="separator:a5388aab8b46f3180b8ebe9001f1e75eb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a441f41e648d284d68e1f2015d40f5e7c"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1search_1_1_search.html#a441f41e648d284d68e1f2015d40f5e7c">radiusSearch</a> (const <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &amp;point, double radius, std::vector&lt; int &gt; &amp;k_indices, std::vector&lt; float &gt; &amp;k_sqr_distances, unsigned int max_nn=0) const =0</td></tr>
<tr class="memdesc:a441f41e648d284d68e1f2015d40f5e7c"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="classpcl_1_1search_1_1_search.html" title="Generic search class. All search wrappers must inherit from this.">Search</a> for all the nearest neighbors of the query point in a given radius.  <a href="classpcl_1_1search_1_1_search.html#a441f41e648d284d68e1f2015d40f5e7c">更多...</a><br /></td></tr>
<tr class="separator:a441f41e648d284d68e1f2015d40f5e7c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a817886100e51afd9d20f323eb095ca2e"><td class="memTemplParams" colspan="2">template&lt;typename PointTDiff &gt; </td></tr>
<tr class="memitem:a817886100e51afd9d20f323eb095ca2e"><td class="memTemplItemLeft" align="right" valign="top">int&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classpcl_1_1search_1_1_search.html#a817886100e51afd9d20f323eb095ca2e">radiusSearchT</a> (const PointTDiff &amp;point, double radius, std::vector&lt; int &gt; &amp;k_indices, std::vector&lt; float &gt; &amp;k_sqr_distances, unsigned int max_nn=0) const</td></tr>
<tr class="memdesc:a817886100e51afd9d20f323eb095ca2e"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="classpcl_1_1search_1_1_search.html" title="Generic search class. All search wrappers must inherit from this.">Search</a> for all the nearest neighbors of the query point in a given radius.  <a href="classpcl_1_1search_1_1_search.html#a817886100e51afd9d20f323eb095ca2e">更多...</a><br /></td></tr>
<tr class="separator:a817886100e51afd9d20f323eb095ca2e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac4d5771324782f22122f9733efeb3e63"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1search_1_1_search.html#ac4d5771324782f22122f9733efeb3e63">radiusSearch</a> (const <a class="el" href="classpcl_1_1_point_cloud.html">PointCloud</a> &amp;cloud, int index, double radius, std::vector&lt; int &gt; &amp;k_indices, std::vector&lt; float &gt; &amp;k_sqr_distances, unsigned int max_nn=0) const</td></tr>
<tr class="memdesc:ac4d5771324782f22122f9733efeb3e63"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="classpcl_1_1search_1_1_search.html" title="Generic search class. All search wrappers must inherit from this.">Search</a> for all the nearest neighbors of the query point in a given radius.  <a href="classpcl_1_1search_1_1_search.html#ac4d5771324782f22122f9733efeb3e63">更多...</a><br /></td></tr>
<tr class="separator:ac4d5771324782f22122f9733efeb3e63"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6806b0255d2921adb04275439cf4cfd6"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1search_1_1_search.html#a6806b0255d2921adb04275439cf4cfd6">radiusSearch</a> (int index, double radius, std::vector&lt; int &gt; &amp;k_indices, std::vector&lt; float &gt; &amp;k_sqr_distances, unsigned int max_nn=0) const</td></tr>
<tr class="memdesc:a6806b0255d2921adb04275439cf4cfd6"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="classpcl_1_1search_1_1_search.html" title="Generic search class. All search wrappers must inherit from this.">Search</a> for all the nearest neighbors of the query point in a given radius (zero-copy).  <a href="classpcl_1_1search_1_1_search.html#a6806b0255d2921adb04275439cf4cfd6">更多...</a><br /></td></tr>
<tr class="separator:a6806b0255d2921adb04275439cf4cfd6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a71d9c395bc2de70831e9bca8ff6b27c9"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpcl_1_1search_1_1_search.html#a71d9c395bc2de70831e9bca8ff6b27c9">radiusSearch</a> (const <a class="el" href="classpcl_1_1_point_cloud.html">PointCloud</a> &amp;cloud, const std::vector&lt; int &gt; &amp;indices, double radius, std::vector&lt; std::vector&lt; int &gt; &gt; &amp;k_indices, std::vector&lt; std::vector&lt; float &gt; &gt; &amp;k_sqr_distances, unsigned int max_nn=0) const</td></tr>
<tr class="memdesc:a71d9c395bc2de70831e9bca8ff6b27c9"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="classpcl_1_1search_1_1_search.html" title="Generic search class. All search wrappers must inherit from this.">Search</a> for all the nearest neighbors of the query point in a given radius.  <a href="classpcl_1_1search_1_1_search.html#a71d9c395bc2de70831e9bca8ff6b27c9">更多...</a><br /></td></tr>
<tr class="separator:a71d9c395bc2de70831e9bca8ff6b27c9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a474c6a0dd4e8fbf9c7f0840c22fb931d"><td class="memTemplParams" colspan="2">template&lt;typename PointTDiff &gt; </td></tr>
<tr class="memitem:a474c6a0dd4e8fbf9c7f0840c22fb931d"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classpcl_1_1search_1_1_search.html#a474c6a0dd4e8fbf9c7f0840c22fb931d">radiusSearchT</a> (const <a class="el" href="classpcl_1_1_point_cloud.html">pcl::PointCloud</a>&lt; PointTDiff &gt; &amp;cloud, const std::vector&lt; int &gt; &amp;indices, double radius, std::vector&lt; std::vector&lt; int &gt; &gt; &amp;k_indices, std::vector&lt; std::vector&lt; float &gt; &gt; &amp;k_sqr_distances, unsigned int max_nn=0) const</td></tr>
<tr class="memdesc:a474c6a0dd4e8fbf9c7f0840c22fb931d"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="classpcl_1_1search_1_1_search.html" title="Generic search class. All search wrappers must inherit from this.">Search</a> for all the nearest neighbors of the query points in a given radius.  <a href="classpcl_1_1search_1_1_search.html#a474c6a0dd4e8fbf9c7f0840c22fb931d">更多...</a><br /></td></tr>
<tr class="separator:a474c6a0dd4e8fbf9c7f0840c22fb931d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected 成员函数</h2></td></tr>
<tr class="memitem:aa15b2e10688acc27e6a87d02192a17b1"><td class="memItemLeft" align="right" valign="top"><a id="aa15b2e10688acc27e6a87d02192a17b1"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>sortResults</b> (std::vector&lt; int &gt; &amp;indices, std::vector&lt; float &gt; &amp;distances) const</td></tr>
<tr class="separator:aa15b2e10688acc27e6a87d02192a17b1"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
Protected 属性</h2></td></tr>
<tr class="memitem:a3044a0a70f8f083400a41b9e34cfa4fc"><td class="memItemLeft" align="right" valign="top"><a id="a3044a0a70f8f083400a41b9e34cfa4fc"></a>
PointCloudConstPtr&#160;</td><td class="memItemRight" valign="bottom"><b>input_</b></td></tr>
<tr class="separator:a3044a0a70f8f083400a41b9e34cfa4fc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6db6521a19458ec8e5ada937bf16dcc1"><td class="memItemLeft" align="right" valign="top"><a id="a6db6521a19458ec8e5ada937bf16dcc1"></a>
IndicesConstPtr&#160;</td><td class="memItemRight" valign="bottom"><b>indices_</b></td></tr>
<tr class="separator:a6db6521a19458ec8e5ada937bf16dcc1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab4c8d2f983d9aeebfb592eb256d1f4d2"><td class="memItemLeft" align="right" valign="top"><a id="ab4c8d2f983d9aeebfb592eb256d1f4d2"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>sorted_results_</b></td></tr>
<tr class="separator:ab4c8d2f983d9aeebfb592eb256d1f4d2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adde2b11155d871a0a835254ca1820591"><td class="memItemLeft" align="right" valign="top"><a id="adde2b11155d871a0a835254ca1820591"></a>
std::string&#160;</td><td class="memItemRight" valign="bottom"><b>name_</b></td></tr>
<tr class="separator:adde2b11155d871a0a835254ca1820591"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><h3>template&lt;typename PointT&gt;<br />
class pcl::search::Search&lt; PointT &gt;</h3>

<p>Generic search class. All search wrappers must inherit from this. </p>
<p>Each search method must implement 2 different types of search:</p><ul>
<li><b>nearestKSearch</b> - search for K-nearest neighbors.</li>
<li><b>radiusSearch</b> - search for all nearest neighbors in a sphere of a given radius</li>
</ul>
<p>The input to each search method can be given in 3 different ways:</p><ul>
<li>as a query point</li>
<li>as a (cloud, index) pair</li>
<li>as an index</li>
</ul>
<p>For the latter option, it is assumed that the user specified the input via a <a class="el" href="classpcl_1_1search_1_1_search.html#a3f7aa9ba73d098c204bc8a6b9dd293dc">setInputCloud</a> () method first.</p>
<dl class="section note"><dt>注解</dt><dd>In case of an error, all methods are supposed to return 0 as the number of neighbors found.</dd>
<dd>
libpcl_search deals with three-dimensional search problems. For higher level dimensional search, please refer to the libpcl_kdtree module.</dd></dl>
<dl class="section author"><dt>作者</dt><dd>Radu B. Rusu </dd></dl>
</div><h2 class="groupheader">构造及析构函数说明</h2>
<a id="a77f437ecf7fa36987632db9c2b450441"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a77f437ecf7fa36987632db9c2b450441">&#9670;&nbsp;</a></span>Search()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename PointT &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classpcl_1_1search_1_1_search.html">pcl::search::Search</a>&lt; <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &gt;::<a class="el" href="classpcl_1_1search_1_1_search.html">Search</a> </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>name</em> = <code>&quot;&quot;</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>sorted</em> = <code>false</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Constructor. </p>
<div class="fragment"><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;  : input_ () </div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;  , indices_ ()</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;  , sorted_results_ (sorted)</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;  , name_ (name)</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;{</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;}</div>
</div><!-- fragment -->
</div>
</div>
<a id="a25fbcca7b8f88fdf464f8c9af576626c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a25fbcca7b8f88fdf464f8c9af576626c">&#9670;&nbsp;</a></span>~Search()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename PointT &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="classpcl_1_1search_1_1_search.html">pcl::search::Search</a>&lt; <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &gt;::~<a class="el" href="classpcl_1_1search_1_1_search.html">Search</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Destructor. </p>
<div class="fragment"><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;        {</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;        }</div>
</div><!-- fragment -->
</div>
</div>
<h2 class="groupheader">成员函数说明</h2>
<a id="a7191bd8166bed4623c27199bf59e972c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7191bd8166bed4623c27199bf59e972c">&#9670;&nbsp;</a></span>nearestKSearch() <span class="overload">[1/4]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename PointT &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classpcl_1_1search_1_1_search.html">pcl::search::Search</a>&lt; <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &gt;::nearestKSearch </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classpcl_1_1_point_cloud.html">PointCloud</a> &amp;&#160;</td>
          <td class="paramname"><em>cloud</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::vector&lt; int &gt; &amp;&#160;</td>
          <td class="paramname"><em>indices</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>k</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; std::vector&lt; int &gt; &gt; &amp;&#160;</td>
          <td class="paramname"><em>k_indices</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; std::vector&lt; float &gt; &gt; &amp;&#160;</td>
          <td class="paramname"><em>k_sqr_distances</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p><a class="el" href="classpcl_1_1search_1_1_search.html" title="Generic search class. All search wrappers must inherit from this.">Search</a> for the k-nearest neighbors for the given query point. </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">cloud</td><td>the point cloud data </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">indices</td><td>a vector of point cloud indices to query for nearest neighbors </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">k</td><td>the number of neighbors to search for </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">k_indices</td><td>the resultant indices of the neighboring points, k_indices[i] corresponds to the neighbors of the query point i </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">k_sqr_distances</td><td>the resultant squared distances to the neighboring points, k_sqr_distances[i] corresponds to the neighbors of the query point i </td></tr>
  </table>
  </dd>
</dl>
<div class="fragment"><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;{</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;  <span class="keywordflow">if</span> (indices.empty ())</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;  {</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;    k_indices.resize (cloud.size ());</div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;    k_sqr_distances.resize (cloud.size ());</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;    <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; cloud.size (); i++)</div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;      <a class="code" href="classpcl_1_1search_1_1_search.html#a97b4eff97eaa23d4586ca9b16d1b0671">nearestKSearch</a> (cloud, <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span> (i), k, k_indices[i], k_sqr_distances[i]);</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;  }</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;  <span class="keywordflow">else</span></div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;  {</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;    k_indices.resize (indices.size ());</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;    k_sqr_distances.resize (indices.size ());</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;    <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; indices.size (); i++)</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;      <a class="code" href="classpcl_1_1search_1_1_search.html#a97b4eff97eaa23d4586ca9b16d1b0671">nearestKSearch</a> (cloud, indices[i], k, k_indices[i], k_sqr_distances[i]);</div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;  }</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;}</div>
<div class="ttc" id="aclasspcl_1_1search_1_1_search_html_a97b4eff97eaa23d4586ca9b16d1b0671"><div class="ttname"><a href="classpcl_1_1search_1_1_search.html#a97b4eff97eaa23d4586ca9b16d1b0671">pcl::search::Search::nearestKSearch</a></div><div class="ttdeci">virtual int nearestKSearch(const PointT &amp;point, int k, std::vector&lt; int &gt; &amp;k_indices, std::vector&lt; float &gt; &amp;k_sqr_distances) const =0</div><div class="ttdoc">Search for the k-nearest neighbors for the given query point.</div></div>
</div><!-- fragment -->
</div>
</div>
<a id="a5d7eedb3e5746257f121cdc675d6a21a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5d7eedb3e5746257f121cdc675d6a21a">&#9670;&nbsp;</a></span>nearestKSearch() <span class="overload">[2/4]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename PointT &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="classpcl_1_1search_1_1_search.html">pcl::search::Search</a>&lt; <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &gt;::nearestKSearch </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classpcl_1_1_point_cloud.html">PointCloud</a> &amp;&#160;</td>
          <td class="paramname"><em>cloud</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>index</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>k</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; int &gt; &amp;&#160;</td>
          <td class="paramname"><em>k_indices</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; float &gt; &amp;&#160;</td>
          <td class="paramname"><em>k_sqr_distances</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p><a class="el" href="classpcl_1_1search_1_1_search.html" title="Generic search class. All search wrappers must inherit from this.">Search</a> for k-nearest neighbors for the given query point. </p>
<dl class="section attention"><dt>注意</dt><dd>This method does not do any bounds checking for the input index (i.e., index &gt;= cloud.points.size () || index &lt; 0), and assumes valid (i.e., finite) data.</dd></dl>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">cloud</td><td>the point cloud data </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">index</td><td>a <em>valid</em> index in <em>cloud</em> representing a <em>valid</em> (i.e., finite) query point </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">k</td><td>the number of neighbors to search for </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">k_indices</td><td>the resultant indices of the neighboring points (must be resized to <em>k</em> a priori!) </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">k_sqr_distances</td><td>the resultant squared distances to the neighboring points (must be resized to <em>k</em> a priori!)</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>number of neighbors found</dd></dl>
<dl class="exception"><dt>异常</dt><dd>
  <table class="exception">
    <tr><td class="paramname">asserts</td><td>in debug mode if the index is not between 0 and the maximum number of points </td></tr>
  </table>
  </dd>
</dl>

<p>被 <a class="el" href="classpcl_1_1search_1_1_octree.html#abfd07d575460088601dae07058f15fb2">pcl::search::Octree&lt; PointT, LeafTWrap, BranchTWrap, OctreeT &gt;</a> 重载.</p>
<div class="fragment"><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;{</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;  assert (index &gt;= 0 &amp;&amp; index &lt; <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span> (cloud.<a class="code" href="classpcl_1_1_point_cloud.html#af16a62638198313b9c093127c492c884">points</a>.size ()) &amp;&amp; <span class="stringliteral">&quot;Out-of-bounds error in nearestKSearch!&quot;</span>);</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;  <span class="keywordflow">return</span> (<a class="code" href="classpcl_1_1search_1_1_search.html#a97b4eff97eaa23d4586ca9b16d1b0671">nearestKSearch</a> (cloud.<a class="code" href="classpcl_1_1_point_cloud.html#af16a62638198313b9c093127c492c884">points</a>[index], k, k_indices, k_sqr_distances));</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;}</div>
<div class="ttc" id="aclasspcl_1_1_point_cloud_html_af16a62638198313b9c093127c492c884"><div class="ttname"><a href="classpcl_1_1_point_cloud.html#af16a62638198313b9c093127c492c884">pcl::PointCloud::points</a></div><div class="ttdeci">std::vector&lt; PointT, Eigen::aligned_allocator&lt; PointT &gt; &gt; points</div><div class="ttdoc">The point data.</div><div class="ttdef"><b>Definition:</b> point_cloud.h:410</div></div>
</div><!-- fragment -->
</div>
</div>
<a id="a97b4eff97eaa23d4586ca9b16d1b0671"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a97b4eff97eaa23d4586ca9b16d1b0671">&#9670;&nbsp;</a></span>nearestKSearch() <span class="overload">[3/4]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename PointT &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual int <a class="el" href="classpcl_1_1search_1_1_search.html">pcl::search::Search</a>&lt; <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &gt;::nearestKSearch </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &amp;&#160;</td>
          <td class="paramname"><em>point</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>k</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; int &gt; &amp;&#160;</td>
          <td class="paramname"><em>k_indices</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; float &gt; &amp;&#160;</td>
          <td class="paramname"><em>k_sqr_distances</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p><a class="el" href="classpcl_1_1search_1_1_search.html" title="Generic search class. All search wrappers must inherit from this.">Search</a> for the k-nearest neighbors for the given query point. </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">point</td><td>the given query point </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">k</td><td>the number of neighbors to search for </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">k_indices</td><td>the resultant indices of the neighboring points (must be resized to <em>k</em> a priori!) </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">k_sqr_distances</td><td>the resultant squared distances to the neighboring points (must be resized to <em>k</em> a priori!) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>number of neighbors found </dd></dl>

<p>在 <a class="el" href="classpcl_1_1search_1_1_kd_tree.html#a6be8fe286786c3b1aeda7d5369f9cb3e">pcl::search::KdTree&lt; SceneT &gt;</a>, <a class="el" href="classpcl_1_1search_1_1_kd_tree.html#a6be8fe286786c3b1aeda7d5369f9cb3e">pcl::search::KdTree&lt; PointTarget &gt;</a>, <a class="el" href="classpcl_1_1search_1_1_octree.html#a1ae29c694452a6cddc236eaef372653e">pcl::search::Octree&lt; PointT, LeafTWrap, BranchTWrap, OctreeT &gt;</a>, <a class="el" href="classpcl_1_1search_1_1_kd_tree.html#a6be8fe286786c3b1aeda7d5369f9cb3e">pcl::search::KdTree&lt; PointT, Tree &gt;</a>, <a class="el" href="classpcl_1_1search_1_1_flann_search.html#a9060d79b5308f121289b0787ac44a990">pcl::search::FlannSearch&lt; PointT, FlannDistance &gt;</a>, <a class="el" href="classpcl_1_1search_1_1_brute_force.html#aff738c5ddff30148a11b0eef6d8eed63">pcl::search::BruteForce&lt; PointT &gt;</a> , 以及 <a class="el" href="classpcl_1_1search_1_1_organized_neighbor.html#a66a84093ee2d0bfd384008e1f84dc57a">pcl::search::OrganizedNeighbor&lt; PointT &gt;</a> 内被实现.</p>

</div>
</div>
<a id="ab79c10fe1e25b8c4a7104dd439e5f6e0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab79c10fe1e25b8c4a7104dd439e5f6e0">&#9670;&nbsp;</a></span>nearestKSearch() <span class="overload">[4/4]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename PointT &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="classpcl_1_1search_1_1_search.html">pcl::search::Search</a>&lt; <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &gt;::nearestKSearch </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>index</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>k</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; int &gt; &amp;&#160;</td>
          <td class="paramname"><em>k_indices</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; float &gt; &amp;&#160;</td>
          <td class="paramname"><em>k_sqr_distances</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p><a class="el" href="classpcl_1_1search_1_1_search.html" title="Generic search class. All search wrappers must inherit from this.">Search</a> for k-nearest neighbors for the given query point (zero-copy). </p>
<dl class="section attention"><dt>注意</dt><dd>This method does not do any bounds checking for the input index (i.e., index &gt;= cloud.points.size () || index &lt; 0), and assumes valid (i.e., finite) data.</dd></dl>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">index</td><td>a <em>valid</em> index representing a <em>valid</em> query point in the dataset given by <em>setInputCloud</em>. If indices were given in setInputCloud, index will be the position in the indices vector.</td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">k</td><td>the number of neighbors to search for </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">k_indices</td><td>the resultant indices of the neighboring points (must be resized to <em>k</em> a priori!) </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">k_sqr_distances</td><td>the resultant squared distances to the neighboring points (must be resized to <em>k</em> a priori!) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>number of neighbors found</dd></dl>
<dl class="exception"><dt>异常</dt><dd>
  <table class="exception">
    <tr><td class="paramname">asserts</td><td>in debug mode if the index is not between 0 and the maximum number of points </td></tr>
  </table>
  </dd>
</dl>

<p>被 <a class="el" href="classpcl_1_1search_1_1_octree.html#a17572ddb4cdfcadfcd03570d10ac064b">pcl::search::Octree&lt; PointT, LeafTWrap, BranchTWrap, OctreeT &gt;</a> 重载.</p>
<div class="fragment"><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;{</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;  <span class="keywordflow">if</span> (indices_ == NULL)</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;  {</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    assert (index &gt;= 0 &amp;&amp; index &lt; <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span> (input_-&gt;points.size ()) &amp;&amp; <span class="stringliteral">&quot;Out-of-bounds error in nearestKSearch!&quot;</span>);</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;    <span class="keywordflow">return</span> (<a class="code" href="classpcl_1_1search_1_1_search.html#a97b4eff97eaa23d4586ca9b16d1b0671">nearestKSearch</a> (input_-&gt;points[index], k, k_indices, k_sqr_distances));</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;  }</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;  <span class="keywordflow">else</span></div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;  {</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    assert (index &gt;= 0 &amp;&amp; index &lt; <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span> (indices_-&gt;size ()) &amp;&amp; <span class="stringliteral">&quot;Out-of-bounds error in nearestKSearch!&quot;</span>);</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;    <span class="keywordflow">if</span> (index &gt;= <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span> (indices_-&gt;size ()) || index &lt; 0)</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;      <span class="keywordflow">return</span> (0);</div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    <span class="keywordflow">return</span> (<a class="code" href="classpcl_1_1search_1_1_search.html#a97b4eff97eaa23d4586ca9b16d1b0671">nearestKSearch</a> (input_-&gt;points[(*indices_)[index]], k, k_indices, k_sqr_distances));</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;  }</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;}</div>
</div><!-- fragment -->
</div>
</div>
<a id="a5388aab8b46f3180b8ebe9001f1e75eb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5388aab8b46f3180b8ebe9001f1e75eb">&#9670;&nbsp;</a></span>nearestKSearchT() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename PointT &gt; </div>
<div class="memtemplate">
template&lt;typename PointTDiff &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classpcl_1_1search_1_1_search.html">pcl::search::Search</a>&lt; <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &gt;::nearestKSearchT </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classpcl_1_1_point_cloud.html">pcl::PointCloud</a>&lt; PointTDiff &gt; &amp;&#160;</td>
          <td class="paramname"><em>cloud</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::vector&lt; int &gt; &amp;&#160;</td>
          <td class="paramname"><em>indices</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>k</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; std::vector&lt; int &gt; &gt; &amp;&#160;</td>
          <td class="paramname"><em>k_indices</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; std::vector&lt; float &gt; &gt; &amp;&#160;</td>
          <td class="paramname"><em>k_sqr_distances</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p><a class="el" href="classpcl_1_1search_1_1_search.html" title="Generic search class. All search wrappers must inherit from this.">Search</a> for the k-nearest neighbors for the given query point. Use this method if the query points are of a different type than the points in the data set (e.g. <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html" title="A point structure representing Euclidean xyz coordinates, and the RGBA color.">PointXYZRGBA</a> instead of <a class="el" href="structpcl_1_1_point_x_y_z.html" title="A point structure representing Euclidean xyz coordinates. (SSE friendly)">PointXYZ</a>). </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">cloud</td><td>the point cloud data </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">indices</td><td>a vector of point cloud indices to query for nearest neighbors </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">k</td><td>the number of neighbors to search for </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">k_indices</td><td>the resultant indices of the neighboring points, k_indices[i] corresponds to the neighbors of the query point i </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">k_sqr_distances</td><td>the resultant squared distances to the neighboring points, k_sqr_distances[i] corresponds to the neighbors of the query point i </td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>注解</dt><dd>This method copies the input point cloud of type PointTDiff to a temporary cloud of type PointT and performs the batch search on the new cloud. You should prefer the single-point search if you don't use a search algorithm that accelerates batch NN search. </dd></dl>
<div class="fragment"><div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;        {</div>
<div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;          <span class="comment">// Copy all the data fields from the input cloud to the output one</span></div>
<div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;          <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="structpcl_1_1traits_1_1field_list.html">pcl::traits::fieldList&lt;PointT&gt;::type</a> FieldListInT;</div>
<div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;          <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="structpcl_1_1traits_1_1field_list.html">pcl::traits::fieldList&lt;PointTDiff&gt;::type</a> FieldListOutT;</div>
<div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;          <span class="keyword">typedef</span> <span class="keyword">typename</span> pcl::intersect&lt;FieldListInT, FieldListOutT&gt;::type FieldList;</div>
<div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160; </div>
<div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;          <a class="code" href="classpcl_1_1_point_cloud.html">pcl::PointCloud&lt;PointT&gt;</a> pc;</div>
<div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;          <span class="keywordflow">if</span> (indices.empty ())</div>
<div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;          {</div>
<div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;            pc.<a class="code" href="classpcl_1_1_point_cloud.html#a2d60b6927b31ef89cd3b97e8173ea4aa">resize</a> (cloud.size());</div>
<div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;            <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; cloud.size(); i++)</div>
<div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;            {</div>
<div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;              pcl::for_each_type &lt;FieldList&gt; (<a class="code" href="structpcl_1_1_nd_concatenate_functor.html">pcl::NdConcatenateFunctor &lt;PointTDiff, PointT&gt;</a> (</div>
<div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;                                              cloud[i], pc[i]));</div>
<div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;            }</div>
<div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;            <a class="code" href="classpcl_1_1search_1_1_search.html#a97b4eff97eaa23d4586ca9b16d1b0671">nearestKSearch</a> (pc,std::vector&lt;int&gt;(),k,k_indices,k_sqr_distances);</div>
<div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;          }</div>
<div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;          <span class="keywordflow">else</span></div>
<div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;          {</div>
<div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;            pc.<a class="code" href="classpcl_1_1_point_cloud.html#a2d60b6927b31ef89cd3b97e8173ea4aa">resize</a> (indices.size());</div>
<div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;            <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; indices.size(); i++)</div>
<div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;            {</div>
<div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;              pcl::for_each_type &lt;FieldList&gt; (<a class="code" href="structpcl_1_1_nd_concatenate_functor.html">pcl::NdConcatenateFunctor &lt;PointTDiff, PointT&gt;</a> (</div>
<div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;                                              cloud[indices[i]], pc[i]));</div>
<div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;            }</div>
<div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;            <a class="code" href="classpcl_1_1search_1_1_search.html#a97b4eff97eaa23d4586ca9b16d1b0671">nearestKSearch</a> (pc,std::vector&lt;int&gt;(),k,k_indices,k_sqr_distances);</div>
<div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;          }</div>
<div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;        }</div>
<div class="ttc" id="aclasspcl_1_1_point_cloud_html"><div class="ttname"><a href="classpcl_1_1_point_cloud.html">pcl::PointCloud</a></div><div class="ttdoc">PointCloud represents the base class in PCL for storing collections of 3D points.</div><div class="ttdef"><b>Definition:</b> point_cloud.h:173</div></div>
<div class="ttc" id="aclasspcl_1_1_point_cloud_html_a2d60b6927b31ef89cd3b97e8173ea4aa"><div class="ttname"><a href="classpcl_1_1_point_cloud.html#a2d60b6927b31ef89cd3b97e8173ea4aa">pcl::PointCloud::resize</a></div><div class="ttdeci">void resize(size_t n)</div><div class="ttdoc">Resize the cloud</div><div class="ttdef"><b>Definition:</b> point_cloud.h:455</div></div>
<div class="ttc" id="astructpcl_1_1_nd_concatenate_functor_html"><div class="ttname"><a href="structpcl_1_1_nd_concatenate_functor.html">pcl::NdConcatenateFunctor</a></div><div class="ttdoc">Helper functor structure for concatenate.</div><div class="ttdef"><b>Definition:</b> concatenate.h:65</div></div>
<div class="ttc" id="astructpcl_1_1traits_1_1field_list_html"><div class="ttname"><a href="structpcl_1_1traits_1_1field_list.html">pcl::traits::fieldList</a></div><div class="ttdef"><b>Definition:</b> point_traits.h:177</div></div>
</div><!-- fragment -->
</div>
</div>
<a id="abe2901bec8399fdd4d62a4275d89528b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abe2901bec8399fdd4d62a4275d89528b">&#9670;&nbsp;</a></span>nearestKSearchT() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename PointT &gt; </div>
<div class="memtemplate">
template&lt;typename PointTDiff &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="classpcl_1_1search_1_1_search.html">pcl::search::Search</a>&lt; <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &gt;::nearestKSearchT </td>
          <td>(</td>
          <td class="paramtype">const PointTDiff &amp;&#160;</td>
          <td class="paramname"><em>point</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>k</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; int &gt; &amp;&#160;</td>
          <td class="paramname"><em>k_indices</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; float &gt; &amp;&#160;</td>
          <td class="paramname"><em>k_sqr_distances</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p><a class="el" href="classpcl_1_1search_1_1_search.html" title="Generic search class. All search wrappers must inherit from this.">Search</a> for k-nearest neighbors for the given query point. This method accepts a different template parameter for the point type. </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">point</td><td>the given query point </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">k</td><td>the number of neighbors to search for </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">k_indices</td><td>the resultant indices of the neighboring points (must be resized to <em>k</em> a priori!) </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">k_sqr_distances</td><td>the resultant squared distances to the neighboring points (must be resized to <em>k</em> a priori!) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>number of neighbors found </dd></dl>
<div class="fragment"><div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;        {</div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;          <a class="code" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> p;</div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;          <a class="code" href="group__common.html#gab978bf1754771246b2f140a5b52a8f8b">copyPoint</a> (point, p);</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;          <span class="keywordflow">return</span> (<a class="code" href="classpcl_1_1search_1_1_search.html#a97b4eff97eaa23d4586ca9b16d1b0671">nearestKSearch</a> (p, k, k_indices, k_sqr_distances));</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;        }</div>
<div class="ttc" id="agroup__common_html_gab978bf1754771246b2f140a5b52a8f8b"><div class="ttname"><a href="group__common.html#gab978bf1754771246b2f140a5b52a8f8b">pcl::copyPoint</a></div><div class="ttdeci">void copyPoint(const PointInT &amp;point_in, PointOutT &amp;point_out)</div><div class="ttdoc">Copy the fields of a source point into a target point.</div><div class="ttdef"><b>Definition:</b> copy_point.hpp:138</div></div>
<div class="ttc" id="astructpcl_1_1_point_x_y_z_r_g_b_a_html"><div class="ttname"><a href="structpcl_1_1_point_x_y_z_r_g_b_a.html">pcl::PointXYZRGBA</a></div><div class="ttdoc">A point structure representing Euclidean xyz coordinates, and the RGBA color.</div><div class="ttdef"><b>Definition:</b> point_types.hpp:540</div></div>
</div><!-- fragment -->
</div>
</div>
<a id="a71d9c395bc2de70831e9bca8ff6b27c9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a71d9c395bc2de70831e9bca8ff6b27c9">&#9670;&nbsp;</a></span>radiusSearch() <span class="overload">[1/4]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename PointT &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classpcl_1_1search_1_1_search.html">pcl::search::Search</a>&lt; <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &gt;::radiusSearch </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classpcl_1_1_point_cloud.html">PointCloud</a> &amp;&#160;</td>
          <td class="paramname"><em>cloud</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::vector&lt; int &gt; &amp;&#160;</td>
          <td class="paramname"><em>indices</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>radius</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; std::vector&lt; int &gt; &gt; &amp;&#160;</td>
          <td class="paramname"><em>k_indices</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; std::vector&lt; float &gt; &gt; &amp;&#160;</td>
          <td class="paramname"><em>k_sqr_distances</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>max_nn</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p><a class="el" href="classpcl_1_1search_1_1_search.html" title="Generic search class. All search wrappers must inherit from this.">Search</a> for all the nearest neighbors of the query point in a given radius. </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">cloud</td><td>the point cloud data </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">indices</td><td>the indices in <em>cloud</em>. If indices is empty, neighbors will be searched for all points. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">radius</td><td>the radius of the sphere bounding all of p_q's neighbors </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">k_indices</td><td>the resultant indices of the neighboring points, k_indices[i] corresponds to the neighbors of the query point i </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">k_sqr_distances</td><td>the resultant squared distances to the neighboring points, k_sqr_distances[i] corresponds to the neighbors of the query point i </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">max_nn</td><td>if given, bounds the maximum returned neighbors to this value. If <em>max_nn</em> is set to 0 or to a number higher than the number of points in the input cloud, all neighbors in <em>radius</em> will be returned. </td></tr>
  </table>
  </dd>
</dl>
<div class="fragment"><div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;{</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;  <span class="keywordflow">if</span> (indices.empty ())</div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;  {</div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;    k_indices.resize (cloud.size ());</div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;    k_sqr_distances.resize (cloud.size ());</div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;    <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; cloud.size (); i++)</div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;      <a class="code" href="classpcl_1_1search_1_1_search.html#a441f41e648d284d68e1f2015d40f5e7c">radiusSearch</a> (cloud, <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span> (i), radius,k_indices[i], k_sqr_distances[i], max_nn);</div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;  }</div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;  <span class="keywordflow">else</span></div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;  {</div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;    k_indices.resize (indices.size ());</div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;    k_sqr_distances.resize (indices.size ());</div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;    <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; indices.size (); i++)</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;      <a class="code" href="classpcl_1_1search_1_1_search.html#a441f41e648d284d68e1f2015d40f5e7c">radiusSearch</a> (cloud,indices[i],radius,k_indices[i],k_sqr_distances[i], max_nn);</div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;  }</div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;}</div>
<div class="ttc" id="aclasspcl_1_1search_1_1_search_html_a441f41e648d284d68e1f2015d40f5e7c"><div class="ttname"><a href="classpcl_1_1search_1_1_search.html#a441f41e648d284d68e1f2015d40f5e7c">pcl::search::Search::radiusSearch</a></div><div class="ttdeci">virtual int radiusSearch(const PointT &amp;point, double radius, std::vector&lt; int &gt; &amp;k_indices, std::vector&lt; float &gt; &amp;k_sqr_distances, unsigned int max_nn=0) const =0</div><div class="ttdoc">Search for all the nearest neighbors of the query point in a given radius.</div></div>
</div><!-- fragment -->
</div>
</div>
<a id="ac4d5771324782f22122f9733efeb3e63"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac4d5771324782f22122f9733efeb3e63">&#9670;&nbsp;</a></span>radiusSearch() <span class="overload">[2/4]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename PointT &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="classpcl_1_1search_1_1_search.html">pcl::search::Search</a>&lt; <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &gt;::radiusSearch </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classpcl_1_1_point_cloud.html">PointCloud</a> &amp;&#160;</td>
          <td class="paramname"><em>cloud</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>index</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>radius</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; int &gt; &amp;&#160;</td>
          <td class="paramname"><em>k_indices</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; float &gt; &amp;&#160;</td>
          <td class="paramname"><em>k_sqr_distances</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>max_nn</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p><a class="el" href="classpcl_1_1search_1_1_search.html" title="Generic search class. All search wrappers must inherit from this.">Search</a> for all the nearest neighbors of the query point in a given radius. </p>
<dl class="section attention"><dt>注意</dt><dd>This method does not do any bounds checking for the input index (i.e., index &gt;= cloud.points.size () || index &lt; 0), and assumes valid (i.e., finite) data.</dd></dl>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">cloud</td><td>the point cloud data </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">index</td><td>a <em>valid</em> index in <em>cloud</em> representing a <em>valid</em> (i.e., finite) query point </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">radius</td><td>the radius of the sphere bounding all of p_q's neighbors </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">k_indices</td><td>the resultant indices of the neighboring points </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">k_sqr_distances</td><td>the resultant squared distances to the neighboring points </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">max_nn</td><td>if given, bounds the maximum returned neighbors to this value. If <em>max_nn</em> is set to 0 or to a number higher than the number of points in the input cloud, all neighbors in <em>radius</em> will be returned. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>number of neighbors found in radius</dd></dl>
<dl class="exception"><dt>异常</dt><dd>
  <table class="exception">
    <tr><td class="paramname">asserts</td><td>in debug mode if the index is not between 0 and the maximum number of points </td></tr>
  </table>
  </dd>
</dl>

<p>被 <a class="el" href="classpcl_1_1search_1_1_octree.html#aca7e9f635a0873e19f6f919e9f4a9d36">pcl::search::Octree&lt; PointT, LeafTWrap, BranchTWrap, OctreeT &gt;</a> 重载.</p>
<div class="fragment"><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;{</div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;  assert (index &gt;= 0 &amp;&amp; index &lt; <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span> (cloud.<a class="code" href="classpcl_1_1_point_cloud.html#af16a62638198313b9c093127c492c884">points</a>.size ()) &amp;&amp; <span class="stringliteral">&quot;Out-of-bounds error in radiusSearch!&quot;</span>);</div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;  <span class="keywordflow">return</span> (<a class="code" href="classpcl_1_1search_1_1_search.html#a441f41e648d284d68e1f2015d40f5e7c">radiusSearch</a>(cloud.<a class="code" href="classpcl_1_1_point_cloud.html#af16a62638198313b9c093127c492c884">points</a>[index], radius, k_indices, k_sqr_distances, max_nn));</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;}</div>
</div><!-- fragment -->
</div>
</div>
<a id="a441f41e648d284d68e1f2015d40f5e7c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a441f41e648d284d68e1f2015d40f5e7c">&#9670;&nbsp;</a></span>radiusSearch() <span class="overload">[3/4]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename PointT &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual int <a class="el" href="classpcl_1_1search_1_1_search.html">pcl::search::Search</a>&lt; <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &gt;::radiusSearch </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &amp;&#160;</td>
          <td class="paramname"><em>point</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>radius</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; int &gt; &amp;&#160;</td>
          <td class="paramname"><em>k_indices</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; float &gt; &amp;&#160;</td>
          <td class="paramname"><em>k_sqr_distances</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>max_nn</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p><a class="el" href="classpcl_1_1search_1_1_search.html" title="Generic search class. All search wrappers must inherit from this.">Search</a> for all the nearest neighbors of the query point in a given radius. </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">point</td><td>the given query point </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">radius</td><td>the radius of the sphere bounding all of p_q's neighbors </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">k_indices</td><td>the resultant indices of the neighboring points </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">k_sqr_distances</td><td>the resultant squared distances to the neighboring points </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">max_nn</td><td>if given, bounds the maximum returned neighbors to this value. If <em>max_nn</em> is set to 0 or to a number higher than the number of points in the input cloud, all neighbors in <em>radius</em> will be returned. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>number of neighbors found in radius </dd></dl>

<p>在 <a class="el" href="classpcl_1_1search_1_1_kd_tree.html#a1a8440ce95705cc552c988fa881ffeb8">pcl::search::KdTree&lt; SceneT &gt;</a>, <a class="el" href="classpcl_1_1search_1_1_kd_tree.html#a1a8440ce95705cc552c988fa881ffeb8">pcl::search::KdTree&lt; PointTarget &gt;</a>, <a class="el" href="classpcl_1_1search_1_1_kd_tree.html#a1a8440ce95705cc552c988fa881ffeb8">pcl::search::KdTree&lt; PointT, Tree &gt;</a>, <a class="el" href="classpcl_1_1search_1_1_flann_search.html#a376242567b2cd559d4828715ea600d08">pcl::search::FlannSearch&lt; PointT, FlannDistance &gt;</a>, <a class="el" href="classpcl_1_1search_1_1_brute_force.html#a78513e310fd524d01781ccf20a45e736">pcl::search::BruteForce&lt; PointT &gt;</a>, <a class="el" href="classpcl_1_1search_1_1_organized_neighbor.html#a51cdc914c82f8b8e103cf86759bfe635">pcl::search::OrganizedNeighbor&lt; PointT &gt;</a> , 以及 <a class="el" href="classpcl_1_1search_1_1_octree.html#ab340ec949e72d0bd6d972d0bdb230ed6">pcl::search::Octree&lt; PointT, LeafTWrap, BranchTWrap, OctreeT &gt;</a> 内被实现.</p>

</div>
</div>
<a id="a6806b0255d2921adb04275439cf4cfd6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6806b0255d2921adb04275439cf4cfd6">&#9670;&nbsp;</a></span>radiusSearch() <span class="overload">[4/4]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename PointT &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="classpcl_1_1search_1_1_search.html">pcl::search::Search</a>&lt; <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &gt;::radiusSearch </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>index</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>radius</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; int &gt; &amp;&#160;</td>
          <td class="paramname"><em>k_indices</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; float &gt; &amp;&#160;</td>
          <td class="paramname"><em>k_sqr_distances</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>max_nn</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p><a class="el" href="classpcl_1_1search_1_1_search.html" title="Generic search class. All search wrappers must inherit from this.">Search</a> for all the nearest neighbors of the query point in a given radius (zero-copy). </p>
<dl class="section attention"><dt>注意</dt><dd>This method does not do any bounds checking for the input index (i.e., index &gt;= cloud.points.size () || index &lt; 0), and assumes valid (i.e., finite) data.</dd></dl>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">index</td><td>a <em>valid</em> index representing a <em>valid</em> query point in the dataset given by <em>setInputCloud</em>. If indices were given in setInputCloud, index will be the position in the indices vector.</td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">radius</td><td>the radius of the sphere bounding all of p_q's neighbors </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">k_indices</td><td>the resultant indices of the neighboring points </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">k_sqr_distances</td><td>the resultant squared distances to the neighboring points </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">max_nn</td><td>if given, bounds the maximum returned neighbors to this value. If <em>max_nn</em> is set to 0 or to a number higher than the number of points in the input cloud, all neighbors in <em>radius</em> will be returned. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>number of neighbors found in radius</dd></dl>
<dl class="exception"><dt>异常</dt><dd>
  <table class="exception">
    <tr><td class="paramname">asserts</td><td>in debug mode if the index is not between 0 and the maximum number of points </td></tr>
  </table>
  </dd>
</dl>

<p>被 <a class="el" href="classpcl_1_1search_1_1_octree.html#a464b3db2b1de5dff0dce4bfa9a792190">pcl::search::Octree&lt; PointT, LeafTWrap, BranchTWrap, OctreeT &gt;</a> 重载.</p>
<div class="fragment"><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;{</div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;  <span class="keywordflow">if</span> (indices_ == NULL)</div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;  {</div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;    assert (index &gt;= 0 &amp;&amp; index &lt; <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span> (input_-&gt;points.size ()) &amp;&amp; <span class="stringliteral">&quot;Out-of-bounds error in radiusSearch!&quot;</span>);</div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;    <span class="keywordflow">return</span> (<a class="code" href="classpcl_1_1search_1_1_search.html#a441f41e648d284d68e1f2015d40f5e7c">radiusSearch</a> (input_-&gt;points[index], radius, k_indices, k_sqr_distances, max_nn));</div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;  }</div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;  <span class="keywordflow">else</span></div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;  {</div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;    assert (index &gt;= 0 &amp;&amp; index &lt; <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span> (indices_-&gt;size ()) &amp;&amp; <span class="stringliteral">&quot;Out-of-bounds error in radiusSearch!&quot;</span>);</div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;    <span class="keywordflow">return</span> (<a class="code" href="classpcl_1_1search_1_1_search.html#a441f41e648d284d68e1f2015d40f5e7c">radiusSearch</a> (input_-&gt;points[(*indices_)[index]], radius, k_indices, k_sqr_distances, max_nn));</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;  }</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;}</div>
</div><!-- fragment -->
</div>
</div>
<a id="a474c6a0dd4e8fbf9c7f0840c22fb931d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a474c6a0dd4e8fbf9c7f0840c22fb931d">&#9670;&nbsp;</a></span>radiusSearchT() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename PointT &gt; </div>
<div class="memtemplate">
template&lt;typename PointTDiff &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classpcl_1_1search_1_1_search.html">pcl::search::Search</a>&lt; <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &gt;::radiusSearchT </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classpcl_1_1_point_cloud.html">pcl::PointCloud</a>&lt; PointTDiff &gt; &amp;&#160;</td>
          <td class="paramname"><em>cloud</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::vector&lt; int &gt; &amp;&#160;</td>
          <td class="paramname"><em>indices</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>radius</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; std::vector&lt; int &gt; &gt; &amp;&#160;</td>
          <td class="paramname"><em>k_indices</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; std::vector&lt; float &gt; &gt; &amp;&#160;</td>
          <td class="paramname"><em>k_sqr_distances</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>max_nn</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p><a class="el" href="classpcl_1_1search_1_1_search.html" title="Generic search class. All search wrappers must inherit from this.">Search</a> for all the nearest neighbors of the query points in a given radius. </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">cloud</td><td>the point cloud data </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">indices</td><td>a vector of point cloud indices to query for nearest neighbors </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">radius</td><td>the radius of the sphere bounding all of p_q's neighbors </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">k_indices</td><td>the resultant indices of the neighboring points, k_indices[i] corresponds to the neighbors of the query point i </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">k_sqr_distances</td><td>the resultant squared distances to the neighboring points, k_sqr_distances[i] corresponds to the neighbors of the query point i </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">max_nn</td><td>if given, bounds the maximum returned neighbors to this value. If <em>max_nn</em> is set to 0 or to a number higher than the number of points in the input cloud, all neighbors in <em>radius</em> will be returned. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>注解</dt><dd>This method copies the input point cloud of type PointTDiff to a temporary cloud of type PointT and performs the batch search on the new cloud. You should prefer the single-point search if you don't use a search algorithm that accelerates batch NN search. </dd></dl>
<div class="fragment"><div class="line"><a name="l00376"></a><span class="lineno">  376</span>&#160;        {</div>
<div class="line"><a name="l00377"></a><span class="lineno">  377</span>&#160;          <span class="comment">// Copy all the data fields from the input cloud to the output one</span></div>
<div class="line"><a name="l00378"></a><span class="lineno">  378</span>&#160;          <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="structpcl_1_1traits_1_1field_list.html">pcl::traits::fieldList&lt;PointT&gt;::type</a> FieldListInT;</div>
<div class="line"><a name="l00379"></a><span class="lineno">  379</span>&#160;          <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="structpcl_1_1traits_1_1field_list.html">pcl::traits::fieldList&lt;PointTDiff&gt;::type</a> FieldListOutT;</div>
<div class="line"><a name="l00380"></a><span class="lineno">  380</span>&#160;          <span class="keyword">typedef</span> <span class="keyword">typename</span> pcl::intersect&lt;FieldListInT, FieldListOutT&gt;::type FieldList;</div>
<div class="line"><a name="l00381"></a><span class="lineno">  381</span>&#160; </div>
<div class="line"><a name="l00382"></a><span class="lineno">  382</span>&#160;          <a class="code" href="classpcl_1_1_point_cloud.html">pcl::PointCloud&lt;PointT&gt;</a> pc;</div>
<div class="line"><a name="l00383"></a><span class="lineno">  383</span>&#160;          <span class="keywordflow">if</span> (indices.empty ())</div>
<div class="line"><a name="l00384"></a><span class="lineno">  384</span>&#160;          {</div>
<div class="line"><a name="l00385"></a><span class="lineno">  385</span>&#160;            pc.<a class="code" href="classpcl_1_1_point_cloud.html#a2d60b6927b31ef89cd3b97e8173ea4aa">resize</a> (cloud.size ());</div>
<div class="line"><a name="l00386"></a><span class="lineno">  386</span>&#160;            <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; cloud.size (); ++i)</div>
<div class="line"><a name="l00387"></a><span class="lineno">  387</span>&#160;              pcl::for_each_type &lt;FieldList&gt; (<a class="code" href="structpcl_1_1_nd_concatenate_functor.html">pcl::NdConcatenateFunctor &lt;PointTDiff, PointT&gt;</a> (cloud[i], pc[i]));</div>
<div class="line"><a name="l00388"></a><span class="lineno">  388</span>&#160;            <a class="code" href="classpcl_1_1search_1_1_search.html#a441f41e648d284d68e1f2015d40f5e7c">radiusSearch</a> (pc, std::vector&lt;int&gt; (), radius, k_indices, k_sqr_distances, max_nn);</div>
<div class="line"><a name="l00389"></a><span class="lineno">  389</span>&#160;          }</div>
<div class="line"><a name="l00390"></a><span class="lineno">  390</span>&#160;          <span class="keywordflow">else</span></div>
<div class="line"><a name="l00391"></a><span class="lineno">  391</span>&#160;          {</div>
<div class="line"><a name="l00392"></a><span class="lineno">  392</span>&#160;            pc.<a class="code" href="classpcl_1_1_point_cloud.html#a2d60b6927b31ef89cd3b97e8173ea4aa">resize</a> (indices.size ());</div>
<div class="line"><a name="l00393"></a><span class="lineno">  393</span>&#160;            <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; indices.size (); ++i)</div>
<div class="line"><a name="l00394"></a><span class="lineno">  394</span>&#160;              pcl::for_each_type &lt;FieldList&gt; (<a class="code" href="structpcl_1_1_nd_concatenate_functor.html">pcl::NdConcatenateFunctor &lt;PointTDiff, PointT&gt;</a> (cloud[indices[i]], pc[i]));</div>
<div class="line"><a name="l00395"></a><span class="lineno">  395</span>&#160;            <a class="code" href="classpcl_1_1search_1_1_search.html#a441f41e648d284d68e1f2015d40f5e7c">radiusSearch</a> (pc, std::vector&lt;int&gt;(), radius, k_indices, k_sqr_distances, max_nn);</div>
<div class="line"><a name="l00396"></a><span class="lineno">  396</span>&#160;          }</div>
<div class="line"><a name="l00397"></a><span class="lineno">  397</span>&#160;        }</div>
</div><!-- fragment -->
</div>
</div>
<a id="a817886100e51afd9d20f323eb095ca2e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a817886100e51afd9d20f323eb095ca2e">&#9670;&nbsp;</a></span>radiusSearchT() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename PointT &gt; </div>
<div class="memtemplate">
template&lt;typename PointTDiff &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="classpcl_1_1search_1_1_search.html">pcl::search::Search</a>&lt; <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &gt;::radiusSearchT </td>
          <td>(</td>
          <td class="paramtype">const PointTDiff &amp;&#160;</td>
          <td class="paramname"><em>point</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>radius</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; int &gt; &amp;&#160;</td>
          <td class="paramname"><em>k_indices</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; float &gt; &amp;&#160;</td>
          <td class="paramname"><em>k_sqr_distances</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>max_nn</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p><a class="el" href="classpcl_1_1search_1_1_search.html" title="Generic search class. All search wrappers must inherit from this.">Search</a> for all the nearest neighbors of the query point in a given radius. </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">point</td><td>the given query point </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">radius</td><td>the radius of the sphere bounding all of p_q's neighbors </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">k_indices</td><td>the resultant indices of the neighboring points </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">k_sqr_distances</td><td>the resultant squared distances to the neighboring points </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">max_nn</td><td>if given, bounds the maximum returned neighbors to this value. If <em>max_nn</em> is set to 0 or to a number higher than the number of points in the input cloud, all neighbors in <em>radius</em> will be returned. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>number of neighbors found in radius </dd></dl>
<div class="fragment"><div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;        {</div>
<div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;          <a class="code" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> p;</div>
<div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;          <a class="code" href="group__common.html#gab978bf1754771246b2f140a5b52a8f8b">copyPoint</a> (point, p);</div>
<div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;          <span class="keywordflow">return</span> (<a class="code" href="classpcl_1_1search_1_1_search.html#a441f41e648d284d68e1f2015d40f5e7c">radiusSearch</a> (p, radius, k_indices, k_sqr_distances, max_nn));</div>
<div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;        }</div>
</div><!-- fragment -->
</div>
</div>
<a id="a3f7aa9ba73d098c204bc8a6b9dd293dc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3f7aa9ba73d098c204bc8a6b9dd293dc">&#9670;&nbsp;</a></span>setInputCloud()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename PointT &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classpcl_1_1search_1_1_search.html">pcl::search::Search</a>&lt; <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &gt;::setInputCloud </td>
          <td>(</td>
          <td class="paramtype">const PointCloudConstPtr &amp;&#160;</td>
          <td class="paramname"><em>cloud</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const IndicesConstPtr &amp;&#160;</td>
          <td class="paramname"><em>indices</em> = <code>IndicesConstPtr&#160;()</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Pass the input dataset that the search will be performed on. </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">cloud</td><td>a const pointer to the <a class="el" href="classpcl_1_1_point_cloud.html" title="PointCloud represents the base class in PCL for storing collections of 3D points.">PointCloud</a> data </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">indices</td><td>the point indices subset that is to be used from the cloud </td></tr>
  </table>
  </dd>
</dl>

<p>被 <a class="el" href="classpcl_1_1search_1_1_kd_tree.html#a457ebf1fc8f25e3b45d0bf9d55880f6f">pcl::search::KdTree&lt; PointT, Tree &gt;</a>, <a class="el" href="classpcl_1_1search_1_1_kd_tree.html#a457ebf1fc8f25e3b45d0bf9d55880f6f">pcl::search::KdTree&lt; PointTarget &gt;</a>, <a class="el" href="classpcl_1_1search_1_1_kd_tree.html#a457ebf1fc8f25e3b45d0bf9d55880f6f">pcl::search::KdTree&lt; SceneT &gt;</a> , 以及 <a class="el" href="classpcl_1_1search_1_1_flann_search.html#ace2468a9ef6db97f6b8d3c76d5ae9366">pcl::search::FlannSearch&lt; PointT, FlannDistance &gt;</a> 重载.</p>
<div class="fragment"><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;{</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;  input_ = cloud;</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;  indices_ = indices;</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;}</div>
</div><!-- fragment -->
</div>
</div>
<a id="af5e9ca2efdb199e64d05c399ea4a4412"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af5e9ca2efdb199e64d05c399ea4a4412">&#9670;&nbsp;</a></span>setSortedResults()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename PointT &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classpcl_1_1search_1_1_search.html">pcl::search::Search</a>&lt; <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &gt;::setSortedResults </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>sorted</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>sets whether the results should be sorted (ascending in the distance) or not </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">sorted</td><td>should be true if the results should be sorted by the distance in ascending order. Otherwise the results may be returned in any order. </td></tr>
  </table>
  </dd>
</dl>

<p>被 <a class="el" href="classpcl_1_1search_1_1_kd_tree.html#a7aacc1d3c6fb2f831feca4d954100cba">pcl::search::KdTree&lt; PointT, Tree &gt;</a>, <a class="el" href="classpcl_1_1search_1_1_kd_tree.html#a7aacc1d3c6fb2f831feca4d954100cba">pcl::search::KdTree&lt; PointTarget &gt;</a> , 以及 <a class="el" href="classpcl_1_1search_1_1_kd_tree.html#a7aacc1d3c6fb2f831feca4d954100cba">pcl::search::KdTree&lt; SceneT &gt;</a> 重载.</p>
<div class="fragment"><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;{</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;  sorted_results_ = sorted;</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;}</div>
</div><!-- fragment -->
</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>search/include/pcl/search/<a class="el" href="search_8h_source.html">search.h</a></li>
<li>search/include/pcl/search/impl/<a class="el" href="search_8hpp_source.html">search.hpp</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><b>pcl</b></li><li class="navelem"><b>search</b></li><li class="navelem"><a class="el" href="classpcl_1_1search_1_1_search.html">Search</a></li>
    <li class="footer">制作者 <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
